package com.lyl.cloud.service;

import com.lyl.cloud.common.base.Result;
import com.lyl.cloud.service.impl.HystrixPaymentServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Service
@FeignClient(name = "CLOUD-HYSTRIX-PAYMENT-SERVICE" ,fallback = HystrixPaymentServiceImpl.class)
public interface HystrixPaymentService {

    /**
     * 超时方法
     * @param id
     * @return
     */
    @GetMapping("/hystrix/timeout/{id:\\d+}")
    public Result timeout(@PathVariable("id") String id);

    /**
     * hystrix正常方法
     * @param id
     * @return
     */
    @GetMapping("/hystrix/ok/{id:\\d+}")
    public Result ok(@PathVariable("id") String id);



}
